package org.example.download;

import java.io.IOException;

public class Main {
    public static void main(String[] args) {
//        String url = "https://cdn-file-ssl.ludashi.com/downloader/temp_package/2024-12/Todesk_b0136713357.exe"; // 替换为实际文件URL
        String url="https://pic1.zhimg.com/v2-5aab236ee98a95dfdf235112245212f4_r.jpg";
        String directoryPath = "E:\\down"; // 替换为实际保存路径
        String fileName = "download.jpg"; // 替换为实际文件名

        int threadCount = 8; // 线程数
        DownloadManager manager = new DownloadManager(url, directoryPath, fileName, threadCount);
        try {
            manager.startDownload();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}